﻿// -----------------------------------------------------------------------
// <copyright file="Debug.cs" company="DarkBone">
// DarkBone
// </copyright>
// -----------------------------------------------------------------------

namespace DarkBone.Engine
{
   using System.Runtime.InteropServices;

   /// <summary>
   /// Debugging colsole
   /// </summary>
   public class DebugConsole
   {
      /// <summary>
      /// Attaches the console.
      /// </summary>
      /// <param name="processId">The dw process id.</param>
      /// <returns>True if console is attached</returns>
      [DllImport("kernel32.dll", SetLastError = true)]
      public static extern bool AttachConsole(uint processId);

      /// <summary>
      /// Allocs the console.
      /// </summary>
      /// <returns>True if console is allocated</returns>
      [DllImport("kernel32", SetLastError = true)]
      public static extern bool AllocConsole();

      /// <summary>
      /// Frees the console.
      /// </summary>
      /// <returns>True if console is allocated</returns>
      [DllImport("kernel32", SetLastError = true)]
      public static extern bool FreeConsole();
   }
}
